#ifndef __CPAR_DICTIONARY__
#define __CPAR_DICTIONARY__

#include <string.h>

typedef struct CPARDictionary CPARDictionary;

typedef long (*CPARDictionaryKeyFn)(void *left, void *right);

static long _CPARDictionaryKeyFnLong(void *left, void *right)
{
  return ((long)left) - ((long)right);
}

static long _CPARDictionaryKeyFnChar(void *left, void *right)
{
  return strcmp((char*)left,(char*)right);
}

cpar_status CPARDictionaryCreate(CPARAllocator *allocator, CPARDictionary **dic, CPARDictionaryKeyFn keyFn);
void        CPARDictionaryDestroy(CPARDictionary *dic);

void        CPARDictionaryAdd(CPARDictionary *dic, void *key, void *value);
void*       CPARDictionaryGetValue(void *key);

#endif /** __CPAR_DICTIONARY__ **/
